home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17445 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: news.San-Jose.ate.slb.com!afzal
  2. From: afzal@San-Jose.ate.slb.com (Afzal Hossain)
  3. Newsgroups: comp.lang.c,comp.lang.c++
  4. Subject: Please help: Borland C compiler on DOS memory allocation problem
  5. Date: 15 Apr 1996 22:09:53 GMT
  6. Organization: Schlumberger Technolgies
  7. Distribution: world
  8. Message-ID: <4kuhfh$k53@k9.San-Jose.ate.slb.com>
  9. Reply-To: afzal@San-Jose.ate.slb.com (Afzal Hossain)
  10. NNTP-Posting-Host: panther.san-jose.ate.slb.com
  11.  
  12.  
  13. Hi,
  14. I would appreciate any help regarding the following problem.
  15. It is a long mail. Thanks a lot.
  16.  
  17. -Afzal Hossain
  18. ============================================================
  19.  
  20.  
  21.  
  22. I am writing a 16-bit C program on DOS and using 
  23. BCC (part of Borlad BC++ 4.0 compiler).
  24. The program itself requires huge amount of memory.
  25. Estimated data size (heap size ?) is about 12 MByte.
  26. Consecutive call to malloc demands a minimum of that
  27. amount of memory. 
  28.  
  29. I have been trying compiling my source modules with
  30. following options :
  31.  
  32.   bcc -v -mh -N -y -A -l-P -lc -lW -Yo  <srcname>.c
  33.  
  34. I put everything in alibrary and finally compile the executable module
  35. this way -
  36.  
  37.   bcc -v -mh -N -y -A -l-P -lc -lW -Y <srcexec>.c -Yo <libname>.lib
  38.  
  39. As you can see I am already using "huge" memory model and code overlays/code
  40. swaping. It stll does not work. It gives a error message "malloc error" at
  41. a malloc check point. However the program actually breaks long before
  42. that by allocating same memory space to several malloc. Therefore one 
  43. overwriting on another's space. Following is the system configuration. I added 8 MB
  44. more memory because I first thought that was the problem. It didn't do any good.
  45.  
  46.          Pentium 133 MB System
  47.          Windows 95 restarted in DOS mode.
  48.          Borlad BC++ 4.0 compiler BCC command line compiler
  49.          8 MB memory + Added additional 8 MB just incase it could be of
  50.                        any help. (system now boots with 16 MB)
  51.  
  52.  
  53. I now have following question:
  54.  
  55. 1. Is the program (requiring 12 MB heap) feasible on a DOS based PC?
  56. 2. What are my choices -
  57.  
  58.  
  59. Thanks again.
  60.  
  61.  
  62.